<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="com.zqc.BorrowInformation"%>
    <%@page import="java.text.SimpleDateFormat"%>
    <%@page import="java.util.Date"%>
    <%@page import="java.util.Calendar"%>
    
    
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="lianjie.jsp"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
	request.setCharacterEncoding("UTF-8");
	String name="";
	String sex="";
	String tel="";
	Object Sname= session.getAttribute("Sname");
	BorrowInformation A = new BorrowInformation();
	Object userID = session.getAttribute("userID");
	Object BookISBN = session.getAttribute("BookISBN");
/* 	Object name = session.getAttribute("se_Name");
	Object sex = session.getAttribute("se_Sex");
	Object dlm = session.getAttribute("se_Dlm");
	Object tel = session.getAttribute("se_Tel");
	 */
	
	String sql = "select * from usermassage where ID='"+userID+"'";
	rs = stmt.executeQuery(sql);
	if (rs.next()) {
		
		name = rs.getString("username");
		sex = rs.getString("sex");
		tel = rs.getString("tel");
	}
	A.setUser_id("userID");
	A.setBook_name("Sname");
	A.setBook_ISBN("BookISBN");
	/* 借书时间 */
	java.sql.Date date = new java.sql.Date(new Date().getTime());
	String str_date = date.toString();
	out.print(str_date);
	/* String date_sql = "update borrowinformation set date = '" + str_date + "'where userID = '" + userID + "' and bookISBN = '" + BookISBN + "'";
	stmt.executeUpdate(date_sql);  */

         
%>
<h2>借阅详情</h2>
<table width ="50%">
	<tr>
			<td width="20">姓名:</td>
			<td width="80"><input type="text" value="<%=name %>" disabled></td>
				
	</tr>
	
	<tr>
			<td width = "20%">电话:</td>
			<td width="80%"><input type="text" value="<%=tel%>" disabled></td>
	</tr>
	
	<tr>
			<td width = "20%">性别:</td>
			
			<td width = "80%"><input type="text" value="<%=sex %>" disabled></td>
	</tr>
	<tr>
			<td width = "20%">书名:</td>
			
			<td width = "80%"><input type="text" value="<%=Sname %>" disabled></td>
	</tr>
	<tr>
			<td width = "20%">借书时间:</td>
			
			<td width = "80%"><input type="text" value="<%=str_date %>" disabled></td>
	</tr>
	<tr>
             <td colspan="1">
             </td>
             
             <td>
                 <input type="button" name="button" value="退出" onClick="tuichu()">
                 <input type="button" name="button" value="继续借阅" onClick="jieyue()">
             </td>
     </tr>
</table>
	<%
	   String sql2="insert into borrowinformation(userID,bookISBN,date,bookname) values('"+userID+"','"+BookISBN+"','"+str_date+"','"+Sname+"')";
	   stmt.executeUpdate(sql2);
	%>
</body>
</html>
<script>
	function tuichu(){
	if(!confirm("提示，您是否要退出登陆？")){
		return;
	}
	window.location.href ="aa_login.jsp?";
}
	function jieyue(){
		if(!confirm("提示，您是否继续借书？")){
			return;
		}
		window.location.href ="student.jsp?";
	}
	
</script>
